-- SEQUENCE: public.AppointmentStatus_AppointmentStatusId_seq

-- DROP SEQUENCE IF EXISTS public."AppointmentStatus_AppointmentStatusId_seq";

CREATE SEQUENCE IF NOT EXISTS public."AppointmentStatus_AppointmentStatusId_seq"
    INCREMENT 1
    START 1
    MINVALUE 1
    MAXVALUE 9223372036854775807
    CACHE 1;

ALTER SEQUENCE public."AppointmentStatus_AppointmentStatusId_seq"
    OWNER TO postgres;


---------------------------------------


-- Table: public.AppointmentStatus

-- DROP TABLE IF EXISTS public."AppointmentStatus";

CREATE TABLE IF NOT EXISTS public."AppointmentStatus"
(
    "AppointmentStatusId" integer NOT NULL DEFAULT nextval('"AppointmentStatus_AppointmentStatusId_seq"'::regclass),
    "Name" character varying(14) COLLATE pg_catalog."default",
    "Active" boolean NOT NULL DEFAULT true,
    "CreatedBy" integer NOT NULL,
    "CreatedDate" timestamp(6) without time zone NOT NULL,
    "ModifiedBy" integer,
    "ModifiedDate" timestamp(6) without time zone,
    "LocationId" integer,
    CONSTRAINT "AppointmentStatus_pkey" PRIMARY KEY ("AppointmentStatusId"),
    CONSTRAINT "FK_AppointmentStatus_CreatedBy" FOREIGN KEY ("CreatedBy")
        REFERENCES public."Account" ("AccountId") MATCH SIMPLE
        ON UPDATE CASCADE
        ON DELETE CASCADE,
    CONSTRAINT "FK_AppointmentStatus_Modifiedby" FOREIGN KEY ("ModifiedBy")
        REFERENCES public."Account" ("AccountId") MATCH SIMPLE
        ON UPDATE CASCADE
        ON DELETE CASCADE
)

TABLESPACE pg_default;

ALTER TABLE IF EXISTS public."AppointmentStatus"
    OWNER to postgres;

COMMENT ON COLUMN public."AppointmentStatus"."AppointmentStatusId"
    IS ' ';